package com.crazy.crazyserviceclient.service;

import com.crazy.crazymodel.model.entity.Customer;
import com.crazy.crazymodel.model.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;

/**
 * @Date: 2024-05-06-20:37
 * @Author: Zheng Zeliang
 */
@FeignClient(name = "crazy-user-service", path = "/api/user/inner")
public interface UserFeignClient {

    /**
     * 根据 id 获取客户
     * @param customerID
     * @return
     */
    @GetMapping("/get/id")
    Customer getById(@RequestParam("customerID") int customerID);

    ///**
    // * 根据 id 获取客户列表
    // * @param idList
    // * @return
    // */
    //@GetMapping("/get/ids")
    //List<Customer> listByIds(@RequestParam("idList") Collection<Integer> idList);

    /**
     * 根据 name和idNumber获取客户
     * @param name,idNumber
     * @return
     */
    @GetMapping("/get/nameID")
    Customer getByNameAndIdNumber(@RequestParam("name") String name,@RequestParam("idNumber") String idNumber);
}
